package com.lu.oss

import com.alibaba.sdk.android.oss.internal.OSSAsyncTask
import com.lu.oss.api.IOssObjectListener

/**
 *author: luqihua
 *date:2022/5/9
 *description:
 **/

enum class OssAction {
    GET, PUT
}

class OssTaskInfo<T>(
    val source: T,
    val ossAction: OssAction,
    val objectKey: String,
    var task: OSSAsyncTask<*>?=null,
    var preProgressTime: Long = System.currentTimeMillis(),
    val listener: IOssObjectListener? = null,
    var retryTime: Int = 0
) {
    fun canRetry() = ++retryTime <= 3
}